$(document).ready(function () {

    $('#btnLogin').bind('click',btnLoginClick);

})

function btnLoginClick(){

    $.ajax({
        url:'../../mock/user.json',
        method:'get',
        dataType:'json',
        success:function (data) {

            if(data.username==$('#username').val()&&data.password==$('#password').val()){
                location.href = "index.html";
            }else{
                 $('#err').show();
            }
        }
    })
}